-+-    Example 4 for DB Dumper  *  Copyright (C) JP 2o1o    -+-

GOAL:
=====
  Extract BLOB data from SQL server to files with unique names taken from some database field.

COMPONENTS:
===========
  Server: SQL 2008
  Driver: SQL Native Client

STEPS:
======
 1) Create script with tables to extract. (Check Script_4.txt)

 2) You can modify connect string to your details. (Server, User, Password, DB name ...)

 3) Load script to DB Dumper and extract your data.


Attached script use BLOB switch = "Y", which mean export BLOB field as file.


Setting example:
  ### WHERE condition
  NOT PICTURE_DATA IS NULL AND PICTURE_FILENAME  <> ''
  ### Defined Tables/Fields
  TABLE; FIELD_BLOB; FIELD_FILENAME; TRY_CONVERT (0/1)
  e.g.
  PICTURES; PICTURE_DATA; PICTURE_FILENAME; 0

Description:
  Export from TABLE blob field FIELD_BLOB and give to file name by contens of field
  FIELD_FILENAME. In FIELD_FILENAME can be integer (ID) or some other string and
  must be uniqe for each file, otherwise files can be owerwriten.
  Export only data that fit WHERE condition: fields that contain some data and
  have no empty file name.
  Some data are not in binary format so export will failed. Data must be before
  converted by setting TRY_CONVERT to 1. (Values can be only 0/1) First time try
  set to 0, if it's not working (files are with zero size) try set to 1.